@extends('layouts.admin')
@section('title','添加规则')

@section('content')

    <!-- Main content -->
    <section class="content">
      <div class="col-md-6" style="width: 100%">
          <!-- Horizontal Form -->
          <div class="box box-info">
            <div class="box-header with-border">
             
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal style-form" method="post" action="{{route('admin.permission.store')}}">
              {{ csrf_field() }}
              <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-2 col-sm-2 control-label">权限标识</label>
                    <div class="col-sm-10">
                        <input type="text"  class="form-control" name="name" id="name"  placeholder="唯一标识如admin.role.xxx" value="{{old('name')}}">
                        <lable class="error error_name"   style="display: inline-block;">{{$errors->first('name')}}</lable>
                    </div>
                    
                </div>

                <div class="form-group">
                    <label class="col-sm-2 col-sm-2 control-label">权限名称</label>
                    <div class="col-sm-10">
                        <input type="text"  class="form-control" name="display_name" id="display_name" placeholder="请输入权限名称" value="{{old('display_name')}}">
                        <lable class="error error_display_name"   style="display: inline-block;">{{$errors->first('display_name')}}</lable>
                    </div>
                    
                </div>

                <div class="form-group">
                    <label class="col-sm-2 col-sm-2 control-label">权限描述</label>
                    <div class="col-sm-10">
                        <input type="text"  class="form-control" name="description" id="description" placeholder="请输入描述" value="{{old('description')}}">
                        <lable class="error error_description"   style="display: inline-block;">{{$errors->first('description')}}</lable>
                    </div>
                   
                   
                </div>
                
                <div class="form-group">
                    <label class="col-sm-2 col-sm-2 control-label">所属栏目</label>
                    <div class="col-sm-10">
                            <select class="form-control" name="cid">
                                <option value="0">初始菜单</option>
                                @foreach($tree as $v)
                                    <option value="{{$v['id']}}">{{$v['display_name']}}</option>
                                   
                                @endforeach
                            </select>
                    </div>
                   
   
                </div>

                
               
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <button type="button" class="btn btn-default" onClick="javascript:history.back()">返回</button>
                <button type="submit" class="btn btn-info pull-right ">提交</button>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
          <!-- /.box -->
          <!-- general form elements disabled -->
     
          <!-- /.box -->
        </div>
    </section>
    <!-- /.content -->
 


@endsection

 @section('script')
    <script src="{{asset('assets/js/jquery.validate.js')}}"></script>
    <script src="{{asset('assets/js/quanxian.js')}}"></script>
   
@endsection